<template>
  <div class="bg">
    <!-- md页面 -->
    <div class="list-tag">
      <div
        class="list-tag-item"
        :class="tagStr == item ? 'active' : ''"
        @click="changeTag(item)"
        v-for="(item, index) in typeList"
        :key="index"
      >
        {{ item }}
      </div>
    </div>
    <div class="list-main">
      <div class="list-note" v-for="(item, index) in list" :key="index">
        <div class="list-note-title">
          <p>{{ item.title }}</p>
        </div>
        <div class="list-note-describe">{{ item.describe }}</div>
        <div class="list-note-sizeViews">
          <div class="list-note-sizeViews-l">文件大小：<span>{{ item.fileSize }}KB</span></div>
          <div class="list-note-sizeViews-r">浏览量：<span>{{ item.views }}</span></div>
        </div>
        <div class="list-note-type">{{ item.type }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          title: "这是笔记的名字",
          views: 100,
          type: "vue",
          fileSize: 125,
          describe: "这是对于笔记的一个描述，这个笔记是一个特别好的笔记",
        },
        {
          title: "这是笔记的名字",
          views: 100,
          type: "vue",
          fileSize: 125,
          describe: "这是对于笔记的一个描述，这个笔记是一个特别好的笔记",
        },
        {
          title: "这是笔记的名字",
          views: 100,
          type: "vue",
          fileSize: 125,
          describe: "这是对于笔记的一个描述，这个笔记是一个特别好的笔记",
        },
        {
          title: "这是笔记的名字",
          views: 100,
          type: "vue",
          fileSize: 125,
          describe: "这是对于笔记的一个描述，这个笔记是一个特别好的笔记",
        },
        {
          title: "这是笔记的名字",
          views: 100,
          type: "vue",
          fileSize: 125,
          describe: "这是对于笔记的一个描述，这个笔记是一个特别好的笔记",
        },
        {
          title: "这是笔记的名字",
          views: 100,
          type: "vue",
          fileSize: 125,
          describe: "这是对于笔记的一个描述，这个笔记是一个特别好的笔记",
        },
      ],
      typeList: [
        "全部",
        "vue",
        "HTML",
        "CSS",
        "Js",
        "react",
        "数据库",
        "Java",
        "node",
      ],
      tagStr: "全部",
    };
  },
  methods: {
    // 切换tag
    changeTag(item) {
      this.tagStr = item;
    },
  },
};
</script>

<style scoped lang="less">
.bg {
  color: black;
}
.list-tag {
  padding-top: 30px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  .list-tag-item {
    padding: 0 40px;
    height: 60px;
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-family: "JGFONT";
    cursor: pointer;
  }
  .active {
    background-color: cadetblue;
  }
}
.list-main {
  width: calc(100% - 100px);
  padding: 30px 50px;
  .list-note {
      height: 200px;
      padding: 20px 30px;
      margin-bottom: 20px;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      border-radius: 20px;
      box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.2);
      cursor: pointer;
    .list-note-title {
        p{
            font-size: 30px;
            font-family: '微软雅黑';
            font-weight: bold;
        }
    }
    .list-note-describe {
        font-size: 18px;
    }
    .list-note-sizeViews {
        display: flex;
      .list-note-sizeViews-l {
          margin-right: 30px;
      }
      .list-note-sizeViews-r {
      }
      span{
          font-size: 17px;
      }
    }
    .list-note-type {
        position: absolute;
        top: 30px;
        right: 30px;
        padding: 5px 10px;
        background-color: chocolate;
        font-size: 17px;
        border-radius: 5px;
        color: white;
    }
  }
}
</style>